package com.soup.lab.junit5;

import org.junit.jupiter.api.Test;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class GenericTestCase {

    interface BaseInterface<T, V> {

        V invoke(T t);

    }

    interface Concrete<K> extends BaseInterface<Integer, String> {

        K get();

    }

    static class A implements Concrete<String> {

        @Override
        public String invoke(Integer integer) {
            return null;
        }

        @Override
        public String get() {
            return null;
        }
    }

    @Test
    public void test() {
        getInvokerGenericTypes(A.class);
    }

    private Type[] getInvokerGenericTypes(Class<?> clazz) {
        Type[] interfaces = clazz.getGenericInterfaces();
        for (Type type : interfaces) {
            Class rawType = (Class) ((ParameterizedType) type).getRawType();
            if(type instanceof ParameterizedType) {
                }
        }
        return null;
    }
}
